<template>
  <div class="atteend_check">
    <AddOutDuty v-if="$route.query.type == '2' && ['3', '4'].includes(dailyStatus)" />
    <DetailOutDuty v-else />
    <!-- <DetailOutDuty v-if="$route.query.type == '1' || $route.query.type == '3' || $route.query.type == '4'" /> -->
  </div>
</template>

<script>
import AddOutDuty from './AddOutDuty'
import DetailOutDuty from './DetailOutDuty'
import { getAttendanceDailyInfo } from '@api/api-attendance.js'
export default {
  components: {
    AddOutDuty,
    DetailOutDuty,
  },
  data() {
    return {
      dailyStatus: '',
    }
  },
  created() {
    this.getDetail()
  },
  mounted() {},
  methods: {
    //获取详情
    getDetail() {
      getAttendanceDailyInfo({
        id: this.$route.query.id,
        formId: this.$route.query.formId,
      }).then(res => {
        if (res.status === 200) {
          this.dailyStatus = res.data.dailyStatus
        }
      })
    },
  },
}
</script>

<style lang="scss" scoped>
.atteend_check {
  height: 100%;
}
</style>
